clear all
use "Data\WVS_Cross-National_Wave_7_Stata_v5_0.dta"

****Table A8 OLS Regression Results of Confucian Values and Democratic Support Based on Sample of the 7th WVS*************

keep Q238 Q27 Q28 Q35 Q38 Q40 Q37 Q42 Q108 Q152 Q154 Q199 Q206 Q260 Q262 Q275 Q288 Q57 Q50 Q200 Q235 A_YEAR C_COW_NUM H_URBRURAL D_INTERVIEW

*************Delete missing values*************
keep if C_COW_NUM == 740  | C_COW_NUM == 816  |  C_COW_NUM ==714 |  C_COW_NUM == 713  |  C_COW_NUM ==732 |  C_COW_NUM == 710 | C_COW_NUM == 830
drop if Q238 < 0
drop if Q27 < 0
drop if Q28 < 0
drop if Q35 < 0
drop if Q38 < 0
drop if Q40 < 0
drop if Q37 < 0
drop if Q42 < 0
drop if Q108 < 0
drop if Q152 < 0
drop if Q154 < 0
drop if Q199 < 0
drop if Q206 < 0
drop if Q260 < 0
drop if Q262 < 0
drop if Q275 < 0
drop if Q288 < 0
drop if Q57 < 0
drop if Q50 < 0
drop if Q200 < 0
drop if Q235 < 0
drop if H_URBRURAL < 0


*************Construct Varibles***********************
recode Q238 (1=4) (2=3) (3=2) (4=1), gen (Democratic_Suitability)
recode Q27 (1=4) (2=3) (3=2) (4=1)
recode Q28 (1=4) (2=3) (3=2) (4=1)
recode Q35 (1=4) (2=3) (3=2) (4=1)
recode Q38 (1=4) (2=3) (3=2) (4=1)
factortest Q27 Q28 Q35 Q38
pca Q27 Q28 Q35 Q38
factor Q27 Q28 Q35 Q38, pcf
screeplot, yline(1)
predict f1
rename f1 Family_Values
recode Q40 (1=4) (2=3) (3=2) (4=1)
recode Q37 (1=4) (2=3) (3=2) (4=1)
factortest Q40 Q37 Q42
pca Q40 Q37 Q42
factor Q40 Q37 Q42, pcf
screeplot, yline(1)
predict f1
rename f1 Social_Values
recode  Q235 (1=4) (2=3) (3=2) (4=1)
recode  Q108 (1=10) (2=9) (3=8) (4=7) (5=6) (6=5) (7=4) (8=3) (9=2) (10=1)
factortest Q108 Q235
pca Q108 Q235
factor Q108 Q235, pcf
screeplot, yline(1)
predict f1
rename f1 Political_Values
recode Q152 (3=1) (4=0) (2=0) (1=0)
recode Q154 (2=1) (4=1) (3=0) (1=0)
factortest Q154 Q152
pca Q154 Q152
factor Q154 Q152, pcf
screeplot, yline(1)
predict f1
rename f1 Democracy_Prority
rename A_YEAR year
rename C_COW_NUM country
rename Q199 Political_Interest
rename Q206 Internet_Use
rename Q260 gender
rename H_URBRURAL Residence
rename Q262 age
rename Q275 education
rename Q288 income
rename Q57 Trust
rename Q50 Family_household
rename year Year
rename Q200 Political_Discussion


reg Democratic_Suitability Family_Values Social_Values Political_Values, robust
est store m1
reg Democratic_Suitability Family_Values Social_Values Political_Values i.country i.Year, robust
est store m2
reg Democratic_Suitability Family_Values Social_Values Political_Values Residence Family_household Trust Political_Interest Internet_Use gender age education income  Political_Discussion, robust
est store m3
reg Democratic_Suitability Family_Values Social_Values Political_Values Residence Family_household Trust Political_Interest Internet_Use gender age education income  Political_Discussion i.country i.Year, robust
est store m4

reg Democracy_Prority Family_Values Social_Values Political_Values, robust
est store m5
reg Democracy_Prority Family_Values Social_Values Political_Values i.country i.Year, robust
est store m6
reg Democracy_Prority Family_Values Social_Values Political_Values Residence Family_household Trust Political_Interest Internet_Use gender age education income, robust
est store m7
reg Democracy_Prority Family_Values Social_Values Political_Values Residence Family_household Trust Political_Interest Internet_Use gender age education income i.country i.Year, robust
est store m8


esttab m1 m2 m3 m4 m5 m6 m7 m8 using "Results/tables/Table A8 OLS Regression Results of Confucian Values and Democratic Support Based on Sample of the 7th WVS.rtf" , se mtitle(BaselineModel_1 BaselineModel_2 BaselineModel_3 BaselineModel_4 BaselineModel_5 BaselineModel_6 BaselineModel_7 BaselineModel_8) keep(Family_Values Social_Values Political_Values _cons) replace b(%12.3f) t(%12.2f) scalars (country Year N r2_a) star(* 0.1 ** 0.05 *** 0.01) nogap compress nonotes note("Note: Robust standard errors in parentheses. *p < 0.1, **p < 0.05, ***p < 0.01. Democratic Suitability is the variable that represents the MSFD (minimum support for democracy) and Democratic Priority is the variable that represents the PSFD (priority support for democracy).")

